# to build it, you should first assign to PATH

ifneq ($(KERNELRELEASE),)

obj-m := i2c_demo.o
i2c_demo-objs := i2c-demo.o
#si3050-objs := SI3050.o hd_if.o
else
# for O1 8176
#KERNEL_DIR := /home/tj/code/O1_8176/alps2/out/target/product/tb8176p1_64_bsp/obj/KERNEL_OBJ
# for P0 8163
#KERNEL_DIR := /home/tj/code/P08163_git/alps/out/target/product/tb8163p3_64_bsp/obj/KERNEL_OBJ
# for rk3308 linux
#KERNEL_DIR := /home/tj/code/RK3308_git/alps2/kernel
# for rk3399
#KERNEL_DIR := /home/tj/code/O13399_git/alps3/kernel
# for 3288 8.1
#KERNEL_DIR := /home/tj/code/RK3288/alps/kernel
#for rk3326 9.0
KERNEL_DIR := /home/tj/code/P03326_git/alps/kernel
# for rk312x 4.4
#KERNEL_DIR := /home/tj/code/rk312x/alps2/kernel
# export PATH=/home/tj/code/O13399_git/alps3/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin:$PATH
all:
	make -C $(KERNEL_DIR) M=$(PWD) modules CROSS_COMPILE=aarch64-linux-android- ARCH=arm64
#	make -C $(KERNEL_DIR) M=$(PWD) modules CROSS_COMPILE=arm-eabi- ARCH=arm
	# make -C $(KERNEL_DIR) M=$(PWD) modules CROSS_COMPILE=arm-linux-androideabi- ARCH=arm

clean:
	rm -f *.o *.ko *.order Module.symvers *.mod.c
endif
